Skip to content

Conversation

@az2924
Copy link
Collaborator

@az2924 az2924 commented Jan 31, 2026

648

Description of changes

  • Removed duplication between Leaderboard and OrgEmbedView
  • Deleted OrgEmbedView

Checklist before review

  • I have done a thorough self-review of the PR
  • Copilot has reviewed my latest changes, and all comments have been fixed and/or closed.
  • If I have made database changes, I have made sure I followed all the db repo rules listed in the wiki here. (check if no db changes)
  • All tests have passed
  • I have successfully deployed this PR to staging
  • I have done manual QA in both dev (and staging if possible) and attached screenshots below.

Screenshots

Dev

Uploading Screenshot 2026-01-31 at 2.08.39 PM.png…
Uploading Screenshot 2026-01-31 at 2.08.25 PM.png…

Staging

Uploading Screenshot 2026-01-31 at 2.37.27 PM.png…
Uploading Screenshot 2026-01-31 at 2.37.20 PM.png…

@github-actions
Copy link
Contributor

Available PR Commands

  • /ai - Triggers all AI review commands at once
  • /review - AI review of the PR changes
  • /describe - AI-powered description of the PR
  • /improve - AI-powered suggestions
  • /deploy - Deploy to staging

See: https://github.com/tahminator/codebloom/wiki/CI-Commands

@github-actions
Copy link
Contributor

Title

648: Combined Leaderboard and LeaderboardEmbed


PR Type

Enhancement


Description

  • Unify embed and main leaderboard components

  • Add embedded mode with tailored UI

  • Support pageSize via URL for embeds

  • Remove duplicate OrgEmbedView implementation


Diagram Walkthrough

flowchart LR
  OrgEmbedView["OrgEmbedView (duplicate)"] -- removed --> CurrentLeaderboard["CurrentLeaderboard (shared)"]
  LeaderboardEmbed["LeaderboardEmbed"] -- uses embedded mode --> CurrentLeaderboard
  CurrentLeaderboard -- passes props --> LeaderboardIndex["LeaderboardIndex"]
  URLParams["URL pageSize param"] -- parsed when embedded --> CurrentLeaderboard
  OrgHeader["OrgHeader"] -- shown in embeds --> LeaderboardIndex
  Filters["Filter controls"] -- hidden in embeds --> LeaderboardIndex
Loading

File Walkthrough

Relevant files
Enhancement
LeaderboardEmbed.tsx
Use shared leaderboard in embed entrypoint                             

js/src/app/embed/leaderboard/LeaderboardEmbed.tsx

  • Replace OrgEmbedView with CurrentLeaderboard
  • Enable embedded mode via embedded prop
+2/-2     
OrgEmbedView.tsx
Delete deprecated OrgEmbedView duplicate                                 

js/src/app/embed/leaderboard/_components/OrgEmbedView.tsx

  • Remove duplicate embedded leaderboard component
  • Delete bespoke fetching, filters, and rendering
+0/-246 
Leaderboard.tsx
Add embedded mode to shared leaderboard                                   

js/src/app/leaderboard/_components/Leaderboard.tsx

  • Add embedded option to share logic with embeds
  • Parse URL pageSize for embedded queries
  • Show OrgHeader and CTA only when embedded
  • Hide filter controls in embedded mode
+117/-64

@github-actions
Copy link
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

SSR Safety

Using window.location.search in getPageSizeFromParams can break in SSR/Next environments; ensure this runs only client-side or guards for window undefined.

function getPageSizeFromParams(): number | undefined {
  const searchParams = new URLSearchParams(window.location.search);
  const pageSizeParam = searchParams.get("pageSize");
  return pageSizeParam ? Number(pageSizeParam) : undefined;
}
Embed Filters

In embedded mode multiple active filters are auto-reset, but the FilterDropdown UI is hidden; confirm this aligns with embed AC and that deep-linked multiple filters are handled predictably.

useEffect(() => {
  if (embedded) {
    const activeCount = Object.typedEntries(filters).filter(
      ([, enabled]) => enabled,
    ).length;
    if (activeCount > 1) {
      onFilterReset();
    }
  }
}, [embedded, filters, onFilterReset]);
Prop Drilling

LeaderboardIndex type narrows query to useCurrentLeaderboardUsersQuery return type even when LeaderboardById passes a different query; verify the types align to avoid hidden type/prop mismatches.

}: LeaderboardOptions & {
  query: ReturnType<typeof useCurrentLeaderboardUsersQuery>;
  startDate?: string;
  endDate?: string;
}) {

@az2924
Copy link
Collaborator Author

az2924 commented Jan 31, 2026

/deploy

@github-actions
Copy link
Contributor

The command to deploy to staging for the commit 50c96f7 has been triggered. View action run

@github-actions
Copy link
Contributor

Staging deployment succeeded for commit 50c96f7

View run

@az2924 az2924 closed this Jan 31, 2026
@az2924 az2924 deleted the 648 branch January 31, 2026 21:38
@codecov
Copy link

codecov bot commented Jan 31, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants